Merged
Conversation
Member
bensabic
commented
Feb 22, 2026
- Configure @vitest/coverage-v8 with coverage reporting (pnpm test:coverage)
- Add unit tests for previously untested modules: token-storage, csv, index, program
- Add comprehensive tests for command modules: members, records, auth (login OAuth flow), apps, custom-fields, permissions, prices, tables
- Cover error handlers, optional fields, branch conditions, and edge cases across all modules
- Update ARCHITECTURE.md and AGENTS.md to document new test files and coverage tooling
- Statements: ~62% → 91.5%, Branches: ~44% → 74%, Tests: 169 → 307
Cover the two library modules that had no test coverage: - token-storage: saveTokens, loadTokens, clearTokens, getValidAccessToken, getAppId, JWT parsing, token refresh, and expiry buffer logic - csv: flattenObject, unflattenObject, readCsvFile, readInputFile, writeOutputFile, and edge cases (empty input, nested objects, arrays)
Add @vitest/coverage-v8 and configure coverage in vitest.config.ts to report on src/**/*.ts (excluding types.ts). Adds text and html reporters, a test:coverage script, and gitignores the coverage dir.
Cover previously untested subcommands and branches: - members: list pagination/--all/--order/empty, create with all options, update --email/no-options, export, import (success/skip/failure/fields), find (field/plan/combined), stats, bulk-update (run/dry-run/missing-id/email), bulk-add-plan (no-plan/dry-run/unknown-filter) - records: query, export (default/custom path), import (success/skip/failure/ data-prefix), bulk-update (run/dry-run/missing-id), bulk-delete (run/dry-run/no-matches)
Cover the CLI entry point behaviors: - Banner prints to stderr by default - Banner suppressed with --quiet and -q flags - NO_COLOR set from --no-color argv or NO_COLOR env - All 13 commands registered via addCommand - parseAsync called, default action shows help
Cover all branches of the login flow including successful OAuth, authorization errors, missing code/state, state mismatch, non-callback 404 paths, registration failure, and error without description.
…rices, and tables Cover error handlers, optional fields, and branch conditions across all five command modules to improve statement coverage from 70-80% to 95-100%.
Test program name, description, version, usage, registered options, configureHelp reordering, and preAction hook for --live/--sandbox flags.
Add new test files to project tree listing, document test:coverage command, and note @vitest/coverage-v8 in dev dependencies.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.